﻿@using QDT.Common
@using QDT.Core
@using QDT.Core.Orders
@model IPagedList<ChargeOrder>
@section HeadSection {
    @Html.IncludeCSS("~/Content/Css/calendar.css")
    @Html.IncludeScript("~/Content/JS/calendar.js")
}
<script type="text/javascript">
    function orderlog(id) {

        var url = '@Url.Action("OrderLog")' + '?id=' + id;

        showAjaxResult(url, "订单日志", 600, 300);
    }
    </script>

<div class="main_title">
    充值订单列表</div>
<div class="blank5">
</div>
<div class="button_row">
    <a class="button" href="javascript: del()">删除</a>
</div>
<div class="blank5">
</div>
<div class="search_row">
	<form name="search" action="@Url.Action("Index")" method="get">	
        订单号：<input type="text" class="textbox" name="orderNo" value="@Request.Params["orderNo"]"/>
	    用户名：<input type="text" class="textbox" name="username" value="@Request.Params["username"]"/>
        开始日期：<input type="text" class="textbox" id="start" name="start" value="@Request.Params["start"]" onfocus=" this.blur(); return showCalendar('start', '%Y-%m-%d', false, false, 'start');" size="8"/>
	    结束日期：<input type="text" class="textbox" id="end" name="end" value="@Request.Params["end"]" onfocus=" this.blur(); return showCalendar('end', '%Y-%m-%d', false, false, 'end');" size="8"/>
        最小值：<input type="text" class="textbox" name="min" value="" style="width:100px;"/>
	    最大值：<input type="text" class="textbox" name="max" value="" style="width:100px;"/>
	    <input type="submit" class="button" value="搜索"/>
	</form>
</div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column =>
{
    column.CheckBox(x => x.ID);
    column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;");
    column.For(x => x.OrderSN).Named("订单号").SortColumnName("OrderSN");
    column.For(x => x.CreateTime).Named("创建时间").SortColumnName("CreateTime");
    column.For(x => Html.ActionLink(Html.F().GetUserName(x.UserID), "Index", "User", new
    {
        userid = x.UserID
    }, "")).Named("会员名称").SortColumnName("UserID");
    column.For(x => x.PayAmount.ToMoney()).Named("已收金额").SortColumnName("PayAmount");
    column.For(x => x.TotalPrice.ToMoney()).Named("应付总额").SortColumnName("TotalPrice");
    column.For(x => Html.F().GetPaymentInfo(x.PaymentKey)).Named("支付方式").SortColumnName("PaymentKey");
    column.For(x => x.Status.ToLocalizable()).Named("支付状态").SortColumnName("InnerStatus");
    column.For(x => x.Memo).Named("支付备注").SortColumnName("Memo");
    column.Buttons(btns => btns
                                .Add(x => x.Status == ChargeOrderStatus.Wait || x.Status == ChargeOrderStatus.Failure ? Html.ActionLink("查询支付结果", "InchargeQuery", new { orderid = x.ID }) : Html.Label(""))
                                .Add(x => x.Status == ChargeOrderStatus.Completed ? Html.ScriptLink("订单日志", "orderlog({0})", x.ID) : Html.Label(""))
                               );
}).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)

